// router/router.go
package router

import (
	"computer_set/Controller"
	"github.com/gin-gonic/gin"
)

// router/router.go
func Router() *gin.Engine {
	r := gin.Default()
	r.SetTrustedProxies([]string{"127.0.0.1", "::1"})

	r.GET("/getAllOrigin", Controller.GetAllOrigin)
	r.GET("/getAllEfficacy", Controller.GetAllEfficacy)
	r.GET("/efficacy-wordcloud", Controller.GetEfficacyWordCloud) // 词云路由
	r.POST("/search-image", Controller.GetImage)                  // 获取图片
	r.GET("/origin-piechart", Controller.GetOriginPieChart)       // 饼图路由
	r.GET("/fake-yield", Controller.GetFakeYieldData)

	// 在router/router.go中添加路由
	r.GET("/body-parts", Controller.GetBodyPartHerbs)

	return r
}
